import javax.swing.tree.TreeNode;
import java.util.Arrays;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode ret = binaryTree.createTree();
        System.out.println("");

//        binaryTree.preOrder(ret);
//        System.out.println(" ");
//        binaryTree.inOrder(ret);
//        System.out.println(" ");
//        binaryTree.postOrder(ret);
//        System.out.println(" ");


      List<BinaryTree.TreeNode> list =  binaryTree.preOrder2(ret);
        for (BinaryTree.TreeNode node: list) {
            System.out.print(node.val+" ");
        }

        System.out.println(" ");
        List<BinaryTree.TreeNode> list2 =  binaryTree.inOrder2(ret);
        for (BinaryTree.TreeNode node: list2) {
            System.out.print(node.val+" ");
        }


        System.out.println(" ");
        List<BinaryTree.TreeNode> list3 =  binaryTree.postOrder2(ret);
        for (BinaryTree.TreeNode node: list3) {
            System.out.print(node.val+" ");
        }

        System.out.println(" ");
        System.out.println(binaryTree.nodeSize(ret));

        System.out.println(" ");
        binaryTree.nodeSize2(ret);
        System.out.println(binaryTree.size);


        System.out.println(" ");
        System.out.println(binaryTree.nodeSize3(ret));

        System.out.println(" ");
        System.out.println(binaryTree.getLeafSize(ret));

        System.out.println(" ");
        System.out.println(binaryTree.getLeafSize2(ret));

        System.out.println(" ");
        System.out.println(binaryTree.getHeight(ret));


        System.out.println(" ");
        BinaryTree.TreeNode treeNode = binaryTree.find(ret,'E');
        System.out.println(binaryTree.find2(ret, 'C'));
        System.out.println(treeNode.val);

        System.out.println(" ");
        System.out.println(binaryTree.isCompleteTree(ret));
    }
}
